set(utd_util_srcdir "${CMAKE_SOURCE_DIR}/utd_util")

# -- Include directories --
list(APPEND UTD_UTIL_INCLUDE_DIRS
  ${utd_util_srcdir}
)

if(${accel} STREQUAL "openmp")
    list(APPEND UTD_UTIL_INCLUDE_DIRS
      ${utd_util_srcdir}/openmp )
elseif(${accel} STREQUAL "opencl")
    list(APPEND UTD_UTIL_INCLUDE_DIRS
      ${utd_util_srcdir}/opencl )
else()
    list(APPEND UTD_UTIL_INCLUDE_DIRS
      ${utd_util_srcdir}/none )
endif()



if(UTD_UTIL_INCLUDE_DIRS)
  set(UTD_UTIL_INCLUDE_DIRS ${UTD_UTIL_INCLUDE_DIRS} PARENT_SCOPE)
endif()

# -- Source files list --
collect_src_from_include_dirs(UTD_UTIL_INCLUDE_DIRS)

# -- Target --
include_directories( ${UTD_UTIL_INCLUDE_DIRS} ${UTD_UTIL_EXTERNAL_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/include)
add_library(utl_util ${SOURCE_FILES} )

target_link_libraries(utl_util ${UTD_UTIL_EXTERNAL_LIBRARIES})

SET_TARGET_PROPERTIES(utl_util PROPERTIES COMPILE_DEFINITIONS ${MODFEM_MPI_CODE_DEFINE})
SET_TARGET_PROPERTIES(utl_util PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}")
SET_TARGET_PROPERTIES(utl_util PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
